package com.lkbaby.home.util;

import lombok.Data;

/**
 * 返回报文体
 *
 * @author luyy26267@yunrong.cn
 * @version V4.0.1
 * @date 2024/3/15 9:42
 * @since 4.0.0
 */
@Data
public class ResponseDto {
	private String code;
	private String desc;
	private Object data;

	private static final String SUCCESS = "000000";

	private static final String ERROR = "999999";

	public static ResponseDto buildSuccess(Object data) {
		ResponseDto responseDto = new ResponseDto();
		responseDto.code = SUCCESS;
		responseDto.data = data;
		return responseDto;
	}

	public static ResponseDto buildError(String desc) {
		ResponseDto responseDto = new ResponseDto();
		responseDto.code = ERROR;
		responseDto.desc = desc;
		return responseDto;
	}
}
